<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!doctype html>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>${attachment.fileName }</title>
    
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<style type="text/css">
		body {margin: 0 auto}
		div {margin: 0 auto; text-align: center;}
	</style>
	<script type="text/javascript" src="<%=path%>/resources/script/jquery/jquery-1.11.3.min.js"></script>
	<script type="text/javascript" src="<%=path%>/resources/script/jquery/media/jquery.media.js"></script>
	<script type="text/javascript">
	 $(function() {
	 	var _w, _h;
	 	if (document.compatMode == 'BackCompat') {
			_w = Math.max(document.body.scrollWidth, document.body.clientWidth),
			_h = Math.max(document.body.scrollHeight, document.body.clientHeight)
		} else {
			_w = Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth),
			_h = Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight)
		}  
        $('a.media').media({width: _w, height: _h});  
    });  
	</script>
  </head>
  <body>
    <div>
    	<a style="display:none;" class="media" href="../atta/${attachment.filePath }"></a>
    </div>
  </body>
</html>
